package com.yangrong.webcrawler.utils;

import java.io.*;

public class SaveNews {

    private static String savefile = "F:\\IdeaProjects\\news-client\\src\\main\\resources\\news\\";

    public void saveAsFileWriter(String content, String fileName) {

        FileWriter fwriter = null;
        try {
            fwriter = new FileWriter(savefile.concat(fileName));
            fwriter.write(content);
        } catch (IOException ex) {
            ex.printStackTrace();
        } finally {
            try {
                fwriter.flush();
                fwriter.close();
            } catch (IOException ex) {
                ex.printStackTrace();
            }
        }
    }
}
